/**
 * Created by Silence on 2016/12/18.
 */

$(document).ready(function () {

    $('.info-nav h2').click(function () {
        clearH2css();
        $(this).addClass('active-info-nav-h2');
        clearPageCss();
        $('.page').eq($(this).index('h2')).removeClass('nodisplay');
    });
    function clearH2css() {
        $('.info-nav h2').removeClass("active-info-nav-h2");
    }
    function clearPageCss() {
        $('.page').addClass('nodisplay');
    }

    /**
     * 滚动条滚动触发事件
     */
    var scrollTop;
    $(window).scroll(function () {
        var docH=$(document).height();
        var winH=$(window).height();
        scrollTop=$(window).scrollTop();
        changeNav(scrollTop);
        if (scrollTop+200>=docH-winH){
            $('#footer').css({'display':'block'});
        }else{
            $('#footer').css({'display':'none'});
        }
        changeFooter(scrollTop);
    });
});